/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 字典选项模块
module.exports = [
  {
    url: '/v1/dictionary/\\d+/dictionary-items$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 93,
            'dictionary_name': '权限通用类型',
            'name': '无',
            'value': '0',
            'description': '',
            'sort': 1,
            'status': 1,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2022-02-28 16:00:26'
          },
          {
            'id': 94,
            'dictionary_name': '权限通用类型',
            'name': '登录',
            'value': '1',
            'description': '登录后都可访问',
            'sort': 2,
            'status': 1,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2021-12-29 00:00:00'
          },
          {
            'id': 95,
            'dictionary_name': '权限通用类型',
            'name': '模块通用',
            'value': '2',
            'description': '登录后模块内有权限则可访问',
            'sort': 3,
            'status': 1,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2021-12-29 00:00:00'
          },
          {
            'id': 96,
            'dictionary_name': '权限通用类型',
            'name': '公共',
            'value': '3',
            'description': '无需登录即可访问',
            'sort': 4,
            'status': 1,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2021-12-29 00:00:00'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 4
        }
      }
      return success(result)
    }
  },
  {
    url: '/v1/dictionary/\\d+/dictionary-items/\\d+$',
    type: 'get',
    response: config => {
      const result = {
        'id': 93,
        'dictionary_name': '权限通用类型',
        'name': '无',
        'value': '0',
        'description': '',
        'sort': 1,
        'status': 1
      }
      return success(result)
    }
  },
  // 添加
  {
    url: '/v1/dictionary/\\d+/dictionary-items$',
    type: 'post',
    response: config => {
      return success({}, '添加成功')
    }
  },
  // 修改
  {
    url: '/v1/dictionary/\\d+/dictionary-items/\\d+$',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟排序
  {
    url: '/v1/dictionary/\\d+/dictionary-items/sort',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟修改状态
  {
    url: '/v1/dictionary/\\d+/dictionary-items/\\d+/status',
    type: 'patch',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟删除
  {
    url: '/v1/dictionary/\\d+/dictionary-items/\.*',
    type: 'delete',
    response: config => {
      return success({}, '删除成功')
    }
  }
]
